home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
FADER
/
ABOUT.C
next >
Wrap
Text File
|
1991-03-01
|
2KB
|
114 lines
/* *******************************
File: About.c
Function: Handle all operations for this Modal Dialog
History: 3/1/91 Original by Prototyper.
******************************* */
#include "About.h"
static pascal char MyFilter (DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
static void Refresh_Dialog(DialogPtr GetSelection);
/* *********************************** */
/* These are the other includes for general routines */
#include "Strings.h"
extern char * strcpy(Str255 *, char *);
/* *********************************** */
#define TRUE 1
#define FALSE 0
#define NIL 0
/* *********************************** */
#define I_OK 1
#define I_x 2
#define I_x3 3
static char ExitDialog;
static char DoubleClick;
static Point myPt;
/* ======================================================== */
/* This is an update routine for non-controls in the dialog */
/* This is executed after the dialog is uncovered by an alert */
static void Refresh_Dialog(GetSelection)
DialogPtr GetSelection;
{
Rect tempRect;
short DType;
Handle DItem;
ControlHandle CItem;
GetDItem(GetSelection,I_OK, &DType, &DItem, &tempRect);
PenSize(3, 3);
InsetRect(&tempRect, -4, -4);
FrameRoundRect(&tempRect, 16, 16);
PenSize(1, 1);
}
/* ======================================================== */
void D_About()
{
DialogPtr GetSelection;
Rect tempRect;
short DType;
short Index;
Handle DItem;
ControlHandle CItem, CTempItem;
Str255 sTemp;
short itemHit;
short temp;
Handle Icon_Handle;
Point NewMouse;
char InIcon;
TEHandle ThisEditText;
DialogPeek TheDialogPtr;
GetSelection = GetNewDialog(2, NIL, (WindowPtr)-1);
ShowWindow(GetSelection);
SelectWindow(GetSelection);
SetPort(GetSelection);
/* Setup initial conditions */
Refresh_Dialog(GetSelection);
ExitDialog = FALSE;
do
{
ModalDialog(NIL, &itemHit);
GetDItem(GetSelection, itemHit, &DType, &DItem, &tempRect);
CItem = (ControlHandle)DItem;
/* Handle it real time */
if (itemHit == I_OK )
{
/* ?? Code to handle this button goes here */
ExitDialog =TRUE;
}
}
while (ExitDialog == FALSE);
/* Get results after dialog */
DisposDialog(GetSelection);
}